/************************************************************************************
* IDbUpdater.h                                                                                 *
*                                                                                   *
* Copyright (C) 2011 Varuna L Amachi                                                *
*                                                                                   *
* This program is free software; you can redistribute it and/or modify              *
* it under the terms of the GNU General Public License as published by              *
* the Free Software Foundation; either version 2 of the License, or any             *
* later version.                                                                    *
*                                                                                   *
* This program is distributed in the hope that it will be useful, but               *
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY        *
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for       *
* more details. You should have received a copy of the GNU General Public           *
* License along with this program; if not, write to the Free Software Foundation,   *
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA                       *
*                                                                                   *
*************************************************************************************/

#ifndef IDBUPDATER_H
#define IDBUPDATER_H

#include <QString>
#include <QSqlDatabase>

#include "collector/CollectorItem.h"
#include "components/playlist_manager/SavedPlaylist.h"

class IDbUpdater {

protected:
    IDbUpdater(){}

public:
    virtual bool addPlaylistInfo(QString playlistName, QSqlDatabase *db = NULL)                     = 0;
    virtual bool addPlaylistItem(QString playlistName, QString trackId, QSqlDatabase *db = NULL)    = 0;
    virtual bool addCollectionItem(CollectorItem *item, QSqlDatabase *db = NULL)                    = 0;
    virtual bool addCollectionItems(QList<CollectorItem*> &collectionItem, QSqlDatabase *db = NULL) = 0;
//  virtual bool addRecentAdditions(QList<CollectorItem*> &item, QSqlDatabase *db = NULL)           = 0;
    virtual bool addRecentAddition(CollectorItem* item, QSqlDatabase *db = NULL)                    = 0;
    virtual bool addHistory(CollectorItem *item, QSqlDatabase *db = NULL)                           = 0;
    virtual bool addSetting(QString key, QString value, QSqlDatabase *db = NULL)                    = 0;
    virtual bool attachTagToItem(QString tagName, CollectorItem* item, QSqlDatabase *db = NULL)     = 0;

    virtual bool clearCollection(QSqlDatabase *database = NULL)                                     = 0;
    virtual bool clearHistory(QSqlDatabase *database = NULL)                                        = 0;
    virtual bool clearRecentAddtions(QSqlDatabase *database = NULL)                                 = 0;

    virtual bool removeHistoryItems(QList<QString>& ids, QSqlDatabase *databse = NULL)              = 0;
    virtual bool removeRecentAdditionItem(QList<QString>& ids, QSqlDatabase *databse = NULL)        = 0;
    virtual bool removePlaylistItem(QString playlist, QString trackId, QSqlDatabase *db = NULL)     = 0;
    virtual bool removeCollectionItem(QString trackId, QSqlDatabase *db = NULL)                     = 0;
    virtual bool removeCollectionItems(QList<QString>* trackIds, QSqlDatabase *db = NULL)           = 0;
    virtual bool removePlaylist(QString playlistName, QSqlDatabase *db = NULL)                      = 0;
    virtual bool removeTagFromItem(QString tag, CollectorItem *item, QSqlDatabase *db = NULL)       = 0;

    virtual bool updateTrackRating(CollectorItem *item, int rating, QSqlDatabase *db = NULL)        = 0;
    virtual bool incrementPlayCount(CollectorItem *item, QSqlDatabase *db = NULL)                   = 0;
    virtual bool updatePlaylistInfo(SavedPlaylist *pl, QSqlDatabase *db = NULL)                     = 0;
    virtual bool updateCollectionInfo(CollectorItem *item, QSqlDatabase *db = NULL)                 = 0;
};

#endif // IDBUPDATER_H
